/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ftpcombiner.gui;

import java.awt.Image;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import javax.imageio.ImageIO;
import javax.swing.Icon;
import javax.swing.ImageIcon;

/**
 *
 * @author Ben
 */
public class GUIResources {

    private static GUIResources instance;
    private Icon[] icons;
    private Image appIcon;
    private ImageIcon loadingIcon;
    private File propsFile;
    private InputStream defaultPropsFile;

    public static GUIResources getInstance() {
        if (instance == null) {
            instance = new GUIResources();
        }
        return instance;
    }

    private GUIResources() {
        icons = new Icon[]{
            new ImageIcon(GUIResources.class.getResource("/resources/folder.png")),
            new ImageIcon(GUIResources.class.getResource("/resources/file.png")),
            new ImageIcon(GUIResources.class.getResource("/resources/up.png")),
            new ImageIcon(GUIResources.class.getResource("/resources/down_arrow.png")),
            new ImageIcon(GUIResources.class.getResource("/resources/up_arrow.png")),
            new ImageIcon(GUIResources.class.getResource("/resources/delete.png")),
            new ImageIcon(GUIResources.class.getResource("/resources/splash.png")),
        };
        try {
            appIcon = ImageIO.read(GUIResources.class.getResource("/resources/app_icon.png"));
            loadingIcon = new ImageIcon(ImageIO.read(GUIResources.class.getResource("/resources/loading.gif")));
        } catch (IOException ex) {
        }
        propsFile = new File(System.getenv("APPDATA") + "\\FTPCombiner\\props.json");
        defaultPropsFile = GUIResources.class.getResourceAsStream("/resources/props.json");

    }

    public Icon getFolderIcon() {
        return icons[0];
    }

    public Icon getFileIcon() {
        return icons[1];
    }

    public Image getAppIconImage() {
        return appIcon;
    }

    public Icon getUpIcon() {
        return icons[2];
    }

    public Icon getDownloadIcon() {
        return icons[3];
    }

    public Icon getUploadIcon() {
        return icons[4];
    }

    public Icon getDeleteIcon() {
        return icons[5];
    }

    public File getPropertiesFile() {
        return propsFile;
    }

    public ImageIcon getLoadingIcon() {
        return loadingIcon;
    }

    public InputStream getDefaultPropertiesStream() {
        return defaultPropsFile;
    }

    public Icon getSplashImage() {
        return icons[6];
    }
}
